-- liquibase formatted sql

-- changeSet Vladislav:1
create table if not exists item(
    id int generated by default as identity primary key,
    code_id int references code(id) on delete cascade not null,
    person_id int references person(id) on delete set null,
    creation_date timestamp without time zone not null,
    checked boolean default false,
    name varchar,
    addr_country varchar,
    addr_city varchar,
    addr_street varchar,
    addr_housenumber varchar,
    properties jsonb,
    polygon geometry(Polygon, 4326),
    line geometry(LineString, 4326)
);

-- rollback drop table item;
